// pagesProperty/pages/event/map/index.js
var amapFile = require('../../../../utils/amap-wx.130.js');Page({
  data: {
    markers: [],
    distance: '',
    cost: '',
    polyline: [],
    type:'',//地图的显示类型  terminal - 终端位置  area - 区域点的位置
    id:0,
    lng:0,
    lat:0,
    showTitle:'',
  },
  onLoad: function(options) {
    console.log(' map  options',options)
    var that = this;
    var markert = {
      id: that.data.id,
      longitude: options.lng,
      latitude: options.lat,
      width: '38rpx',
      height: '66rpx',
      callout: {
        // 点击marker展示title
        content: options.title,
        display:'ALWAYS',
        padding:20,
        bgColor:'#ffffff'
      }
    }
    this.data.markers.push(markert);

    this.setData({
      lng: that.options.lng,
      lat: that.options.lat,
      markers: this.data.markers
    })
  },
  goDetail: function(){
    wx.navigateTo({
      url: '../navigation_car_detail/navigation'
    })
  },
  goToCar: function (e) {
    wx.redirectTo({
      url: '../navigation_car/navigation'
    })
  },
  goToBus: function (e) {
    wx.redirectTo({
      url: '../navigation_bus/navigation'
    })
  },
  goToRide: function (e) {
    wx.redirectTo({
      url: '../navigation_ride/navigation'
    })
  },
  goToWalk: function (e) {
    wx.redirectTo({
      url: '../navigation_walk/navigation'
    })
  }
})